<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>系统首页</title>
    <link rel="stylesheet" href="{$CSS}/bootstrap3.3.7.min.css">
    <style>
        em{
            font-size: 20px;
            color: red;
            vertical-align: middle;
            line-height: 20px;
            height: 20px;
            display: inline-block;
        }
        .mar{
            margin-right:10px
        }
        .pic{
        	float:none;margin-bottom:10px
        }
        .pic img{
        	width: 100px;
    		height: 100px;
    	}
    </style>
</head>
<body style="overflow-x:hidden;">
    <div style="padding:10px;border-bottom:1px solid #eee;font-size:15px;font-weight:700">密码修改&nbsp;&nbsp;[<a href="updatePwd.html">密码修改</a>]</div>
    <div style="margin:40px auto;">
        <div class="bs-example" data-example-id="simple-horizontal-form">
            <form class="form-horizontal" method="post" action="" name="clientForm" id="clientForm">
			{if Session::get('hupc')=='0'}     
             <strong>温馨提示</strong>：系统检测您的密码过于简单，请更新密码后继续使用！！
            {/if}
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">账号</label>
                    <div class="col-sm-3" style="line-height:35px">
						{$un}
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>原密码</label>
                    <div class="col-sm-3">
						 <input name="oldpwd" id="oldpwd" type="password" class="form-control" placeholder="原密码">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>新密码</label>
                    <div class="col-sm-3">
						 <input name="newpwd" id="newpwd" type="password" class="form-control" placeholder="新密码">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>确认密码</label>
                    <div class="col-sm-3">
						  <input name="renewpwd" id="renewpwd" type="password" class="form-control" placeholder="确认密码">
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"></label>
                    <div class="col-sm-5">
						  （为了系统安全，密码长度尽量八位以上，至少要包含字母和数字，尽量包含大小写字母和数字组合）
                    </div>
                </div>
                <div class="form-group">
                   <label for="inputPassword3" class="col-sm-2 control-label"></label>
                    <div class="col-sm-6">
					    <input class="btn btn-success mar" type="hidden" name="action" value="add" />
                        <input class="btn btn-success mar" name="btnAdd" ID="btnAdd" type="button" value="提交">
                        <input class="btn btn-warning mar" name="reset" ID="Submit1" type="reset" value="重置">
                        <input class="btn btn-danger mar"  name="back" ID="back" type="button" onclick="history.back();" value="返回">
                        </div>
                </div>
				
            </form>
        </div>

    </div>
</body>

</html>
<script type="text/javascript">
$(function(){
	 
  $("#btnAdd").click(function(){
	  var oldpwd   = $("#oldpwd").val();
	  var pwd   = $("#newpwd").val();
	  var pwd1 = $("#renewpwd").val();
	  var id       = $("#id").val();
	  if(pwd == '' || pwd1 == '' || oldpwd == ''){
		  tusi('请填写完整。');
		  return false;
	  }
	  if(pwd!= pwd1){
		  tusi('两次密码不一致!');
		  return false;
	  }
	  if(oldpwd == pwd){
		  tusi('新旧密码不能相同!');
		  return false;
	  }
	  ajax('updatePwd.html',{ pwd:pwd,pwd1:pwd1,oldpwd:oldpwd},function(data){
		  if(data == 0){
			  tusi('两次密码不一致!');
			  return false;
		  }else if(data == 2){
			  tusi('不能为空');
			  return false;
		  }else if(data ==3){
			  tusi('原密码不正确!');
		  }else{
			  tusi('操作成功');
			  $("#oldpwd").val("");
			  $("#newpwd").val('');
			  $("#renewpwd").val('');
			//  window.location.reload();
			  
		  }
		  
	  });
  });
});


</script>